<%--
 *  @Author: Kevinfan
 *  Date:    2010/12/23
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.ExperienceInfo");
  String strModuleName = "ERM";
  String privilegeCode = "10341";
  String contextPath = request.getContextPath();
  HashMap userinfo = (HashMap)session.getAttribute("userinfo");
%>
<% //--------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%int LangNums = ConstantProp.multiLangNumber;%>
<html>
<head>
<title>DoctorEdit</title>
<PageFlow:CheckPageFlow pageName="p_zylexperienceinfo"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/Calendar.js"></script>
<script language="JavaScript">
function page_add()
{
  if(!checkALLElems(document.getElementById("newdetail"))) return;
  cform.actionname.value = "add";
  cform.target = "_self";
  //isRunning = true;
  __submitData("pageform",true);
}

function page_delete()
{
  if(isNullChecked(cform.deleteids)) 
  {
    alert('<%=message.getMessageDesc("PLEASE_SELECT")%>');
    return;
  }
  if(!confirm('<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>'))
     return;
  cform.actionname.value = "delete";
  cform.target = "_self";
  //isRunning = true;
  __submitData("pageform",true);
}

function page_selectCheckbox(flag,dicvalues){
		var status = "height=400, width=300,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
		if(flag == 'view'){
			url = "<%=contextPath %>/zyl/masterdata/erm/SelectCheckbox.jsp?<%= OvalTools.randomURL() %>&dicvalues=" + dicvalues + "&flag=2";
		}else{
			url = "<%=contextPath %>/zyl/masterdata/erm/SelectCheckbox.jsp?<%= OvalTools.randomURL() %>&dictype=ExpertType&flag=2";
		}
		if (typeof popwindow1 != 'undefined') popwindow1.close();
		popwindow1 = window.open(url, "newwindow1", status);
}

function page_setStr(str)
{	
    document.cform.expertstype.value = str;
}

function page_allcheckselect(){
	var allcheck = cform.allcheck.checked;
	var alldatafile = document.getElementsByName('deleteids');
	var length = alldatafile.length;
	if(allcheck){
		for(var i = 0 ; i < length;i++){
			alldatafile[i].checked = true;
		}
	}else{
		for(var i = 0 ; i < length;i++){
			alldatafile[i].checked = false;
		}	
	}
}
</script>
</head>
<%
String strDisplayFlag="";
if(request.getParameter("displayflag")!=null)
{
  strDisplayFlag=request.getParameter("displayflag");
}
%>
<iframe name="reloadHandler" style="display:none" ></iframe>
<body style="overflow: auto;">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
	<form id="pageform" name="cform" method="post" action="/oval/Dispatcher" >
  	<input type="hidden" name="pagename" value="p_zylexperienceinfo">
  	<input type="hidden" name="actionname">
  	<input type="hidden" name="maker" value="1">
  	<input type="hidden" name="doctorid" value="<%=pageContext.getAttribute("doctorid")%>">
		<tr class="deepblue-left"> 
		  	<td width="4%" class="title_center"><input type="checkbox" name="allcheck" class="normalradio" onclick="page_allcheckselect();"></td>
          	<td class="title_center"><%= label.getLabelName("L_StartDate") %><font color="RED">*</font></td>
	  		<td class="title_center"><%= label.getLabelName("L_EndingDate") %><font color="RED">*</font></td>
			<td class="title_center"><%= label.getLabelName("L_WorkPlace") %><font color="RED">*</font></td>
			<td class="title_center"><%= label.getLabelName("L_Departments") %><font color="RED">*</font></td>
			<td class="title_center"><%= label.getLabelName("L_Position1") %></td>
			<td class="title_center"><%= label.getLabelName("L_ExpertType") %></td>
			<td class="title_center"><%= label.getLabelName("L_ExpertLevel") %></td>
	  	</tr>
	 	<%
            Vector experienceinfo=(Vector)pageContext.getAttribute("experienceinfo");
            if(experienceinfo == null)
              experienceinfo = new Vector();
            int i=1;
            String strClassType="none";
          %>
          <logic:iterate id="experienceinfoitem" collection="<%= experienceinfo %>" >
          <%
          	HashMap PSMap = (HashMap)pageContext.getAttribute("experienceinfoitem");
            Integer oColIndexLang=new Integer(i);
            if(i%2==0)
              strClassType="td-listrom";
            else
              strClassType="none";
            i++;
          %>
         <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull(strClassType)%>'"  class="<%=JspHelper.filterNull(strClassType)%>"> 
            <td class="title_center"> 
              	<input type="checkbox" name="deleteids" id="deleteids<%=JspHelper.filterNull(i-1)%>" value="<custom:write name="experienceinfoitem" property="docexperienceid"/>" class="normalradio" />
            </td>
            <td class="td_center"><custom:write name="experienceinfoitem" property="startdate" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="experienceinfoitem" property="enddate" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="experienceinfoitem" property="workhospital" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="experienceinfoitem" property="department" nbsp="true"/></td>
           	<td class="td_center"><custom:write name="experienceinfoitem" property="position" nbsp="true"/></td>
           	<td class="td_center"><a href="javascript:page_selectCheckbox('view','<custom:write name="experienceinfoitem" property="expertstype" nbsp="true"/>')"><img src="<%=contextPath %>/images/<%= strLanguageCode %>/ss.png" border="0" ></a></td>
           	<td class="td_center"><custom:write name="experienceinfoitem" dictType="ExpertLevel" property="expertlevel" nbsp="true"/></td>
          </tr>
          </logic:iterate>
      	  <tr >
         	<td class="title_center">&nbsp;</td>
	  		<td class="td_center">
	  		<custom:text property="startdate" dataType="date" dataFormatName="dateformat"  command="notnull" size="20"  label="L_StartDate" onfocus="c.show(this,'cform.startdate','yyyy-MM-dd')" />
	  		</td>
	  		<td class="td_center">
	  		<custom:text property="enddate" dataType="date" command="notnull" dataFormatName="dateformat" size="20"  label="L_EndingDate" onfocus="c.show(this,'cform.enddate','yyyy-MM-dd')" />
	  		</td>
			<td class="td_center"><custom:text property="workhospital" command="notnull" label="L_WorkPlace"/></td>
			<td class="td_center"><custom:text property="department" command="notnull" label="L_Departments"/></td>
			<td class="td_center"><custom:text property="position"  label="L_Position1"/></td>
			<td class="td_center"><custom:text property="expertstype" label="L_ExpertType"/>
				<a onclick="javascript:page_selectCheckbox('add');"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a>
			</td>
			<td class="td_center"><custom:selectdic dictType="ExpertLevel"  property="expertlevel" label="L_ExpertLevel"/></td>
       	  </tr>
       </form>
	</table>
	<%if(!(strDisplayFlag).equals("view")){%>
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td class="summary_top"></td>
		</tr>
		<tr>
			<td class="td_center">
				<a onclick="javascript:page_add();"><custom:button type="2" label="L_Add" imgsrc="add.gif" border="0" style="width:60"/></a>
				<a onclick="javascript:page_delete();"><custom:button type="2" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
			</td>
			
		</tr>
	</table>
	<%} %>
</body>
</html>